package org.litespring.test.v3;

import org.junit.Assert;
import org.junit.Test;
import org.litespring.context.ApplicationContext;
import org.litespring.context.support.ClassPathXmlApplicationContext;
import org.litespring.service.v3.PetStoreService;

public class ApplicationContextTestV3 {

    @Test
    public void testGetBeanProperty(){
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("petstore-v3.xml");
        PetStoreService petStoreService = (PetStoreService) applicationContext.getBean("petStore");
        Assert.assertNotNull(petStoreService.getAccountDAO());
        Assert.assertNotNull(petStoreService.getItemDAO());
        Assert.assertEquals("shenziqi",petStoreService.getName());
        Assert.assertEquals(13,petStoreService.getAge());
    }

}
